/**
 *    @file       normalserver.cpp
 *
 *    @brief      
 *    @details
 *
 *    @version    1.0
 *    @date       02/14/2014 01:26:54 AM
 *
 *    @author     Theophilus (), wangtf418@gmail.com 
 */
#include "normalserver.h"
#include "classfactory.h"

normalserver::normalserver()
{

}

normalserver::~normalserver()
{

}
bf_int_t normalserver::init()
{
	bf_int_t ret = server::init();
	if (ret != BF_OK)
	{
		return BF_ERROR;
	}

	m_classfactory = new classfactory;
	return BF_OK;
}

bf_int_t normalserver::start()
{
	bf_int_t ret = BF_OK;
	threadgroup *grp = NULL;

	//timer thread
	grp = new threadgroup(THD_TYPE_TIMER, 1, NULL);
	ret = grp->init();
	if (ret != BF_OK)
	{
		return BF_ERROR;
	}

	//maintain thread
	grp = new threadgroup(THD_TYPE_MAINTAIN, 1, NULL);
	ret = grp->init();
	if (ret != BF_OK)
	{
		return BF_ERROR;
	}

	return BF_OK;
}



